package com.siliconlabs.bledemo.features.iop_test.models

class CommonUUID {
    companion object {
        const val ID_READ_ONLY_LENGTH_1 = 0
        const val ID_READ_ONLY_LENGTH_255 = 1

        const val ID_WRITE_ONLY_LENGTH_1 = 2
        const val ID_WRITE_ONLY_LENGTH_255 = 3

        const val ID_WRITE_WITHOUT_RESPONSE_LENGTH_1 = 4
        const val ID_WRITE_WITHOUT_RESPONSE_LENGTH_255 = 5

        const val ID_NOTIFICATION_LENGTH_1 = 6
        const val ID_NOTIFICATION_LENGTH_MTU_3 = 7

        const val ID_INDICATE_LENGTH_1 = 8
        const val ID_INDICATE_LENGTH_MTU_3 = 9

        const val ID_IOP_TEST_LENGTH_1 = 10
        const val ID_IOP_TEST_LENGTH_255 = 11

        const val ID_IOP_TEST_LENGTH_VARIABLE_4 = 12

        const val ID_IOP_TEST_CONST_LENGTH_1 = 13
        const val ID_IOP_TEST_CONST_LENGTH_255 = 14

        const val ID_IOP_TEST_USER_LEN_1 = 15
        const val ID_IOP_TEST_USER_LEN_255 = 16
        const val ID_IOP_TEST_USER_LEN_VARIABLE_4 = 17

        const val ID_CONNECTION_PARAMETERS = 18
        const val ID_FIRMWARE_VERSION = 19
        const val ID_IOP_TEST_PHASE3_CONTROL = 20
        const val ID_IOP_TEST_PHASE3_THROUGHPUT = 21
        const val ID_IOP_TEST_PHASE3_SECURITY_PAIRING = 22
        const val ID_IOP_TEST_PHASE3_SECURITY_AUTHENTICATION = 23
        const val ID_IOP_TEST_PHASE3_SECURITY_BONDING = 24
        const val ID_IOP_TEST_PHASE3_GATT_CATCHING = 25
        const val ID_IOP_TEST_PHASE3_OTA_CONTROL = 26
        const val ID_IOP_TEST_PHASE3_SERVICE_CHANGED = 27
        const val ID_IOP_TEST_PHASE3_CLIENT_SUPPORT_FEATURES = 28
        const val ID_IOP_TEST_PHASE3_DATABASE_HASH = 29
        const val ID_IOP_TEST_PHASE3_SERVICE_CHANGED_INDICATION = 30
        const val ID_IOP_DEVICE_NAME = 31

        const val ID_DEVICE_NAME = 32
        const val ID_APPEARANCE = 33
        const val ID_CENTRAL_ADDRESS_RESOLUTION = 34
        const val ID_SERVICE_CHANGED = 35
    }

    /**
     * Service UUIDs
     */
    enum class Service(private val stringValue: String, private val id: Int) {
        UUID_PROPERTIES_SERVICE("75247986-db67-4e19-b0e3-df8e8170be68", 0),  // uuid service

        TEST_PARAMETERS("6a2857fe-9092-4e97-8aae-c028e5b361a8", 1),

        UUID_CHARACTERISTICS_SERVICE("3976265f-098c-4253-a2cd-99c16eb13f5c", 2),  // uuid service

        UUID_PHASE3_SERVICE("0b282ff4-5347-472b-93da-f579103420fa", 3),

        UUID_BLE_OTA("1d14d6ee-fd63-4fa1-bfa4-8f47b42119f0", 4),  // uuid service

        UUID_GENERIC_ATTRIBUTE("00001801-0000-1000-8000-00805f9b34fb", 5),

        UUID_GENERIC_ACCESS("00001800-0000-1000-8000-00805f9b34fb", 6);

        override fun toString(): String {
            return stringValue
        }
    }

    /**
     * Characteristics UUIDs
     */
    enum class Characteristic(private val stringValue: String, val id: Int) {
        // READ
        READ_ONLY_LENGTH_1("b3319040-a720-44ce-84ec-d1a69420bbfb", ID_READ_ONLY_LENGTH_1),
        READ_ONLY_LENGTH_255("b3319040-a720-44ce-84ec-d1a69420bbfc", ID_READ_ONLY_LENGTH_255),

        // WRITE
        WRITE_ONLY_LENGTH_1("38333e40-1d8f-47df-a850-9ced9508be27", ID_WRITE_ONLY_LENGTH_1),
        WRITE_ONLY_LENGTH_255("38333e40-1d8f-47df-a850-9ced9508be28", ID_WRITE_ONLY_LENGTH_255),

        // WRITE WITHOUT RESPONSE
        WRITE_WITHOUT_RESPONSE_LENGTH_1("b8c15871-f456-40bc-9785-c144af510fa6", ID_WRITE_WITHOUT_RESPONSE_LENGTH_1),
        WRITE_WITHOUT_RESPONSE_LENGTH_255("b8c15871-f456-40bc-9785-c144af510fa7", ID_WRITE_WITHOUT_RESPONSE_LENGTH_255),

        // NOTIFICATION
        NOTIFICATION_LENGTH_1("14d56543-42e5-4771-a7f3-526dc92463a2", ID_NOTIFICATION_LENGTH_1),
        NOTIFICATION_LENGTH_MTU_3("14d56543-42e5-4771-a7f3-526dc92463a3", ID_NOTIFICATION_LENGTH_MTU_3),

        // INDICATE
        INDICATE_LENGTH_1("2f1a964e-22f4-4e03-9edf-751c74f5793c", ID_INDICATE_LENGTH_1),
        INDICATE_LENGTH_MTU_3("2f1a964e-22f4-4e03-9edf-751c74f5793d", ID_INDICATE_LENGTH_MTU_3),

        IOP_TEST_LENGTH_1("999ef454-a850-427f-a87f-e72bc00471ff", ID_IOP_TEST_LENGTH_1),
        IOP_TEST_LENGTH_255("d4138f32-397d-407c-8275-a5dad47e4de6", ID_IOP_TEST_LENGTH_255),
        IOP_TEST_LENGTH_VARIABLE_4("df8ff726-2022-4f9c-8b4d-96fd4acd3c71", ID_IOP_TEST_LENGTH_VARIABLE_4),
        IOP_TEST_CONST_LENGTH_1("d4138f32-397d-407c-8275-a5dad47e4de7", ID_IOP_TEST_CONST_LENGTH_1),
        IOP_TEST_CONST_LENGTH_255("d4138f32-397d-407c-8275-a5dad47e4de8", ID_IOP_TEST_CONST_LENGTH_255),
        IOP_TEST_USER_LEN_1("bb250d1b-154a-4aed-bfde-0c5e8d577064", ID_IOP_TEST_USER_LEN_1),
        IOP_TEST_USER_LEN_255("bb250d1b-154a-4aed-bfde-0c5e8d57705e", ID_IOP_TEST_USER_LEN_255),
        IOP_TEST_USER_LEN_VARIABLE_4("bb250d1b-154a-4aed-bfde-0c5e8d57705f", ID_IOP_TEST_USER_LEN_VARIABLE_4),
        CONNECTION_PARAMETERS("6cb60323-2d62-473d-8815-b73df2ee3517", ID_CONNECTION_PARAMETERS),
        FIRMWARE_VERSION("9e453fb5-42ee-4ed0-aaa4-74e11fc2c79f", ID_FIRMWARE_VERSION),
        IOP_TEST_PHASE3_CONTROL("148fd3c4-a00f-3905-d743-e94268e757e3", ID_IOP_TEST_PHASE3_CONTROL),
        IOP_TEST_THROUGHPUT("47b73dd6-dee3-4da1-9be0-f5c539a9a4be", ID_IOP_TEST_PHASE3_THROUGHPUT),
        IOP_TEST_SECURITY_PAIRING("8824e363-7392-4bfc-81b6-3e58104cb2b0", ID_IOP_TEST_PHASE3_SECURITY_PAIRING),
        IOP_TEST_SECURITY_AUTHENTICATION("d14a264f-cdac-c2a4-dce5-9b9ca2073aba", ID_IOP_TEST_PHASE3_SECURITY_AUTHENTICATION),
        IOP_TEST_SECURITY_BONDING("6a978442-f37b-a07c-1a5f-0e6f15a5fc83", ID_IOP_TEST_PHASE3_SECURITY_BONDING),
        IOP_TEST_GATT_CATCHING("b5178061-69ce-46a9-3740-7b3c580953b0", ID_IOP_TEST_PHASE3_GATT_CATCHING),
        IOP_TEST_OTA_CONTROL("f7bf3564-fb6d-4e53-88a4-5e37e0326063", ID_IOP_TEST_PHASE3_OTA_CONTROL),
        IOP_TEST_PHASE3_SERVICE_CHANGED("00002a05-0000-1000-8000-00805f9b34fb", ID_IOP_TEST_PHASE3_SERVICE_CHANGED),
        IOP_TEST_PHASE3_CLIENT_SUPPORT_FEATURES("00002b29-0000-1000-8000-00805f9b34fb", ID_IOP_TEST_PHASE3_CLIENT_SUPPORT_FEATURES),
        IOP_TEST_PHASE3_DATABASE_HASH("00002b2a-0000-1000-8000-00805f9b34fb", ID_IOP_TEST_PHASE3_DATABASE_HASH),
        IOP_TEST_SERVICE_CHANGED_INDICATION("a6abf2eb-b18d-e60f-5667-a9cd9e2971f1", ID_IOP_TEST_PHASE3_SERVICE_CHANGED_INDICATION),
        IOP_DEVICE_NAME("00002a00-0000-1000-8000-00805f9b34fb", ID_IOP_DEVICE_NAME),

        DEVICE_NAME("00002A00-0000-1000-8000-00805f9b34fb", ID_DEVICE_NAME),
        APPEARANCE("00002A01-0000-1000-8000-00805f9b34fb", ID_APPEARANCE),
        CENTRAL_ADDRESS_RESOLUTION("00002AA6-0000-1000-8000-00805f9b34fb", ID_CENTRAL_ADDRESS_RESOLUTION),
        SERVICE_CHANGED("00002A05-0000-1000-8000-00805f9b34fb", ID_SERVICE_CHANGED);

        override fun toString(): String {
            return stringValue
        }
    }
}